<?php
/**
 * Description:
 * Author: hezhizheng
 * Date: 2018/9/18
 * Time: 16:38
 * Created by Created by Panxsoft.
 */

namespace App\Services\Repositories\Pack;

use App\Models\Store\PackCategory;
use Illuminate\Database\Eloquent\Collection;

class PackCategoryRepository
{
    private $packCategory;

    public function __construct()
    {
        $this->packCategory = new PackCategory;
    }

    /**
     * @param int $customer_id
     *
     * @return Collection
     */
    public function searchByCustomerId(int $customer_id): Collection
    {
        $pack_categories = $this->packCategory
            ->where('customer_id', $customer_id)
            ->latest('priority')
            ->get();

        return $pack_categories;
    }
}